<?php

namespace Fluency\Web\Routing;

use Fluency\Web\Http\Request;

/**
 * A router that always returns the same pre-specified request.
 *
 * @package Fluency\Web\Routing
 * @author  Ignas Rudaitis
 * @since   1.0
 */
class FallbackRouter implements Router
{
    private $request;

    /**
     * The constructor.
     *
     * @param Fluency\Web\Http\Request $request the request to return on queries
     */
    public function __construct(Request $request)
    {
        $this->request = $request;
    }

    /**
     * @see Fluency\Web\Routing\Router::query()
     *
     * @param string $url
     * @return Fluency\Web\Http\Request
     */
    public function query($url)
    {
        return $this->request;
    }
}
